[WIP] Start adding structure logging, output to logfmt #427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a structured logger with output to logfmt format (which is both human readable and supported by most log ingestors).
Some ideas borrowed from https://github.com/karlseguin/log.zig.
My goal is to give each connection a unique conn_id, and each CDP message a req_id. The logger will get passed into CDP + Browser/Session/Page and even ideally into zig-js-runtime. The goal is to generate logs like:
Every log has a
_time
,_level
and_ctx
field. The "context" is just meant to be a unique label - nothing worse than getting a log message and not knowing where it originated (although it isn't a substitute for metrics, group by on_ctx
can also be used to detect issues).If everyone's ok with this, I want to close this PR and re-open it after #422 has been merged with more of the
std.log
switched over to use this.